package com.xucy.springboot.designmodel.behavioral.interpreter;

/**
 * @Author xucy
 * @Date 2019-10-31 17:31
 * @Description
 **/

public class MinusOperation extends NonTerminalExpression {

    public MinusOperation(Expression e1, Expression e2) {
        super(e1, e2);
    }

    //将两个表达式相减
    @Override
    public int interpreter(Context context) {
        return this.e1.interpreter(context) - this.e2.interpreter(context);
    }
}
